package cn.tedu.boot06.controller;

import cn.tedu.boot06.entity.Product;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AxiosController {

    @RequestMapping("helloAxios")
    public String helloAxios(){
        return "测试成功";
    }

    @RequestMapping("/p1")
    public String p1(String name,int age){
        return name+":"+age;
    }

    @RequestMapping("/p2")
    public String p2(@RequestBody Product product){
        System.out.println("product = " + product);
        return product.toString();
    }
}
